Programmatic Access in MS Outlook

Using the MS Office Library functions, it is possible to read information, such as body text and email address, from incoming emails. However, Outlook may display a warning window that allows you to provide access for up to 10 minutes.

Enabling Programmatic Access

Try and disable the warning in the MS Outlook Trust Center (this option may be disabled by corporate group policy) on every machine that runs RTClient. If this is not allowed, edit the registry. See https://www.slipstick.com/developer/change-programmatic-access-options/.

If these options are unavailable, automate enabling programmatic access.

To disable the warning:

1. Select File > Options > Trust Center and click Trust Center Settings.
2. Select Programmatic Access. If possible, disable the warning.

3. If you cannot change the setting, edit the registry on to disable the warning (the following example registry entries are applicable to MS Office 2010 x86/x64).
a. Ensure that you have Administrator rights.
b. Save the following text in a file with an extension .reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Outlook\Security]

"ObjectModelGuard"=dword:00000002

Replace the build number as required.

Version

Build Number

2007

12.0

2010

14.0

2013

15.0

2016

16.0

c. Double-click the .reg file to add the entry to HKEY_LOCAL_MACHINE.
d. Similarly, add the following to HKEY_CURRENT_USER:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\office\14.0\Outlook\Security]

"PromptOOMSend"=dword:00000002

"AdminSecurityMode"=dword:00000003

"promptoomaddressinformationaccess"=dword:00000002

"promptoomaddressbookaccess"=dword:00000002

Replace the build number as required.

Automating Enabling Programmatic Access

If the organization does not allow you to disable programmatic access from Outlook or modify the registry, you will need to automate enabling programmatic access. Download the embedded sample project here.

RTClient cannot locate the warning if it is displayed when calling synchronous versions of some functions in the MS Office Functions library. In this case, use the asynchronous versions of the functions.

To automate enabling programmatic access:

1. Capture the warning.

2. Create a workflow that selects Allow Access for, sets the time interval to 10 minutes and then clicks Allow.

3. Add a rule to check if the popup exists, and if it exists, invoke the AllowAccessNewMail workflow. This enables RTClient to locate the programmatic access security popup and allow access for 10 minutes.

Synchronous and Asynchronous MS Outlook Functions

Use synchronous functions if you do not need to automate enabling programmatic access:

Get All Outlook Folder Mail Items

Get Outlook Folder Mail Items Using Folder Hierarchy

Get Outlook Folder Mail Items Using Folder Hierarchy and Oldest Date Limit

Use asynchronous functions if you do need to automate enabling programmatic access:

Asynchronously Get All Outlook Folder Mail Items

Asynchronously Get Outlook Folder Mail Items Using Folder Hierarchy

Asynchronously Get Outlook Folder Mail Items Using Folder Hierarchy and Oldest Date Limit